<template>
  <view class="coma-container">
    <view class="coma-title">子组件A</view>
    <view class="coma-content">
      <text>父组件传进来的值：</text>
      <text class="coma-value">{{ intent }}</text>
    </view>
    <button class="coma-btn" @click="sendData()">传值给CompB组件</button>
  </view>
</template>

<script>
export default {
  props: ['intent'],
  methods: {
    sendData() { uni.$emit('sendToComB', this.intent) }
  }
}
</script>

<style scoped>
.coma-container {
  background: #ffcc80;
  padding: 15rpx;
  margin: 20rpx 0;
}
.coma-title {
  font-size: 32rpx;
  font-weight: bold;
  margin-bottom: 10rpx;
}
.coma-content {
  font-size: 28rpx;
  margin-bottom: 15rpx;
}
.coma-value {
  color: red;
  font-weight: bold;
}
.coma-btn {
  background: #4285f4;
  color: white;
  border: none;
  padding: 8rpx 15rpx;
  font-size: 28rpx;
}
</style>